package com.easylinkin.linkappapi.openapi.service;

import com.easylinkin.linkappapi.device.entity.Device;
import com.easylinkin.linkappapi.device.entity.DeviceModel;
import com.easylinkin.linkappapi.deviceunit.entity.DeviceUnit;
import com.easylinkin.linkappapi.openapi.dto.OnlineState;

import java.io.IOException;
import java.util.List;

/**
 * <p>数据推送通知服务</p>
 * <p>linkthings平台向调用AEP，向AEP发数据</p>
 *
 * @author TongJie
 * @since 2020/11/7 12:22
 */
public interface DataPushService {

    DeviceModel getDeviceModel(String deviceCodee);

    void onlineStateChange(List<OnlineState> onlineStates);

    /**
     * 设备流水推送（物模型参数）后更新设备属性状态，并且产生告警推送
     *
     * @param device     设备
     * @param deviceUnit 设备型号
     * @param data       推送数据
     */
    void updateDeviceAttrStatusAndGenerateAlarm(Device device, DeviceUnit deviceUnit, Object data, Long timestamp);

    void dataPush(String json) throws IOException;
}
